require("dotenv/config");
const {defineModule, startServer} = require("d8d-design-cloud");
const exportCode = require("./src/exportCode.js");

defineModule("loadAppCode", [], () => {
  return {
    default: async (appId) => {
      console.log("loadExportAppCode", appId);

      return {
        backendCode: exportCode.backendCode,
        backendConfig: exportCode.backendConfig,
      };
    },
  };
});

defineModule("loadNpmImports", [], () => {
  return {
    default: async () => {
      return {
        npmImports: exportCode.npmImports,
      };
    },
  };
});

startServer();
